﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Windows.Forms;

namespace WinForm {
    public partial class FormGroupAdd : Form
    {
        public FormGroupAdd()
        {
            InitializeComponent();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            Model.ContactGroup model = new Model.ContactGroup();
            model.GroupName = txtName.Text.Trim();
            model.Memo = txtRemark.Text.Trim();
            BLL.ContactGroup bll = new BLL.ContactGroup();
            string msg;
            if (bll.Add(model,out msg)) {
                MessageBox.Show("添加分类成功。");
            }
            else {
                MessageBox.Show(msg);
            }
        }
        
        private void FormGroupAdd_Load(object sender, EventArgs e)
        {

        }
    }
}
